﻿#ifndef NOTES_TRACK_H
#define NOTES_TRACK_H
#include <vector>

#include "MLObj.h"
#include "Note.h"
#include "Stream.h"

#include "Drawer.h"

class NotesTrack {
public:
	NotesTrack(
		NoteStream& stream,
		int frame_size_x, int frame_size_y,
		double frame_rate,
		size_t tracks_num,
		size_t track_index,
		Color raw_color,
		Byte alpha,
		double play_speed,
		GLuint glsl,
		GLuint mix_glsl,
		int record_radius,
		double border_brightness,
		double center_brightness,
		double border_radius,
		double middle_color_loc
	);
	void clear();
	void get_frame(size_t frame_index, MLFrame& frame);

private:
	int _frame_size_x, _frame_size_y;

	size_t _center_x;
	size_t _center_y;
	double _max_radius;

	double _play_speed;

	GLuint _glsl;
	GLuint _mix_glsl;
	std::vector<DoubleSector> _double_sectors;
	SharedFramebuffer _sharedFB;

	int _draw_start = 0;

	size_t _notes_count;

	float* _start_angle;
	float* _end_angle;

	uint8_t* _r;
	uint8_t* _g;
	uint8_t* _b;

	size_t* _start_duration;
	size_t* _end_duration;
	size_t _end_radius;
};
#endif
